<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="pub/top_list2.jsp"%>
<%
String names = (String) request.getSession().getAttribute("name");
/* String username=null;
String address=null;
String tele=null; */
String sql = "select * from manageadd where userid=?";
String[] params = new String[1];
params[0] =names; 
List<Map<String, Object>> list = db.queryList(sql, params); 

%>

<body>
	<header class="top-header fixed-header">
		<a class="icona" href="self.jsp">
				<img src="images/left.png"/>
			</a>
		<h3>地址管理</h3>		
			<a class="text-top" href="go-address.jsp" style="width:65px">
				添加新地址
			</a>
	</header>
	
	<div class="contaniner fixed-conta">
		<dl class="address">
			
		<%
			for (Map<String, Object> m : list) {
				String username=(String)m.get("username");
				String tele=(String)m.get("telephone");
				String province=(String)m.get("province");
				String city=(String)m.get("city");
				String distric=(String)m.get("distric");
				String address=(String)m.get("address");
				String xxaddr=province+city+distric+address;
				int state=(Integer)m.get("state");
				int id=(Integer)m.get("id");
			
		%>
			<a href="go-address1.jsp?l=<%=id %>&username=<%=username %>&tele=<%=tele %>&province=<%=province %>&city=<%=city %>&distric=<%=distric %>&address=<%=address %>&state=<%=state %>">
				<dt>
					<p><%=username %></p>
					<span><%=tele %></span>
					<%if(state==1) {%>
						<small>默认</small>
					<%} %>
				</dt>
				<dd><%=xxaddr %></dd>
			</a>
		<%}%>			
		</dl>
	</div>
	
	
	
	

</body>
</html>